package org.example.springboot.controller;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.springboot.common.page.PageResult;
import org.example.springboot.common.utils.Result;
import org.example.springboot.entity.FmcBeacon;
import org.example.springboot.entity.FmcStatus;
import org.example.springboot.query.FmcBeaconQuery;
import org.example.springboot.query.FmcStatusQuery;
import org.example.springboot.service.FmcBeaconService;
import org.example.springboot.service.FmcStatusService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/fmc-status")
@AllArgsConstructor
public class FmcStatusController {
    @Resource
    private final FmcStatusService fmcStatusService;

    @PostMapping("page")
    public Result<PageResult<FmcStatus>> page(@RequestBody FmcStatusQuery query) {
        PageResult<FmcStatus> page = fmcStatusService.page(query);
        return Result.ok(page);
    }

}